<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2015/12/22
  Time: 10:55
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<%@ page language="java"  contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"  %>
<%@include file="inc/comm.jsp" %>
<%@include file="inc/inc_head.jsp" %>
<html>
<head>
    <meta charset="utf-8"/>
    <title>质量管理系统</title>
    <style type="text/css">
/*        .main-container {
            margin-top: 100px;
        }*/
        .login-layout .widget-box {
            background-color: rgba(235, 235, 235, 0.5);
        }
        .white {
            font-weight: bold !important;
        }
    </style>

</head>
<body class="login-layout" style="background:url(${ctx}/resources/css/images/bg2.jpg) center !important;">
<div class="main-container">
    <div class="main-content">
        <div class="row">
            <div class="col-sm-10 col-sm-offset-1">
                <div class="login-container">
                    <div class="center">
                        <h2>
                            <i class=" fa fa-leaf green"></i>
                            <span class="white">质量管理系统</span>
                        </h2>

                    </div>

                    <div class="space-6"></div>

                    <div class="position-relative">
                        <div id="login-box" class="login-box visible widget-box no-border">
                            <div class="widget-body">
                                <div class="widget-main">
                                    <h4 class="header blue lighter bigger">
                                        <i class="fa fa-coffee green"></i>
                                        用户登录
                                    </h4>

                                    <div class="space-6"></div>
                                    <c:if test="${not empty error}">
                                        <div class="error alert alert-danger" title="${sessionScope.SPRING_SECURITY_LAST_EXCEPTION}">
                                            <strong>${error}</strong>
                                        </div>

                                    </c:if>

                                    <form id="form" method="post" action="${ctx}/login">
                                        <fieldset>
                                            <label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input id="UserName" name="j_username" type="text"
                                                                   class="form-control" placeholder="Username"/>
															<i class="icon-user"></i>
														</span>
                                            </label>

                                            <label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input value="" id="Password" name="j_password" type="password"
                                                                   class="form-control" placeholder="Password"/>
															<i class="icon-lock"></i>
														</span>
                                            </label>



                                            <div class="space"></div>

                                            <div class="clearfix">
                                                <%--<label class="inline">--%>
                                                    <%--<input type="checkbox" class="ace" name="remember-me"/>--%>
                                                    <%--<span class="lbl"> 两周内自动登录</span>--%>
                                                <%--</label>--%>

                                                <input type="submit" value="登录" class="width-35 pull-right btn btn-sm btn-primary">
                                                    <i class="icon-key"></i>
                                                </input>
                                            </div>

                                            <div class="space-4"></div>
                                        </fieldset>
                                    </form>

                                </div>
                                <!-- /widget-main -->


                            </div>
                            <!-- /widget-body -->
                        </div>
                        <!-- /login-box -->


                    </div>
                    <!-- /position-relative -->
                </div>
            </div>
            <!-- /.col -->
        </div>
        <!-- /.row -->
    </div>
</div>
<!-- /.main-container -->

</body>

<script>
    <%--function flush(){--%>
        <%--$("#tupian").attr("src","${ctx}/resources/code.jsp?time="+new Date());--%>
    <%--}--%>
   /* function login(){
        if ($('#form').form('validate')){
            $('#form').submit();
        }
    }*/

    $(function () {
        if(${errorCount>2}){
           $("#validateCode").removeAttrs("hidden");
            $("#code").attr("required","true");
            $("#code").attr("name","formCode");
        }
    });
</script>
</html>
